<template>
  <div>
    <v-chart theme="macarons" :options="option" autoresize  :style="{ width: '100%', height: height }" />
  </div>
</template>

<script>
import ECharts from 'vue-echarts/components/ECharts'
import 'echarts/theme/macarons'
export default {
  props: {
    linedata: Object,
    height: {
      type: String,
      default: '400px'
    }
  },
  components: {
    'v-chart': ECharts
  },
  data () {
    return {
      option: {
        title: {
          text: this.linedata.title
        },
        xAxis: {
          type: 'category',
          data: this.linedata.dataMain
        },
        tooltip: {
          trigger: 'axis'
        },
        yAxis: {
          type: 'value'
        },
        series: [{
          data: this.linedata.dataValue,
          type: this.linedata.type
        }]
      }
    }
  }
}
</script>
